USE [NGroup.VTL.DB]
GO

/****** Object:  StoredProcedure [dbo].[GetUserInformation]    Script Date: 12/25/2013 22:43:08 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetUserInformation]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[GetUserInformation]
GO

USE [NGroup.VTL.DB]
GO

/****** Object:  StoredProcedure [dbo].[GetUserInformation]    Script Date: 12/25/2013 22:43:08 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


-- =============================================
-- Author:		Bui Thanh Nam
-- Create date: 20131222
-- Description:	Get user's information
-- =============================================
CREATE PROCEDURE [dbo].[GetUserInformation]
	@Username		NVARCHAR(50),
	@Password		NVARCHAR(200)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	 SELECT TOP 1 [ID]
		,[RoleID]
		,[Username]
		,[Password]
		,[UserAlias]
		,[CreatedAt]
		,[CreatedBy]
		,[LastUpdatedAt]
		,[LastUpdatedBy]
	  FROM [NGroup.VTL.DB].[dbo].[Users]
	  WHERE 
			[Username] = @Username
			AND [Password] = @Password
			AND [IsActive] <> 0

END


GO

